package com.luyuan.crm.formula.service.impl;

import java.util.List;

import org.hibernate.criterion.Order;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import com.luyuan.crm.formula.model.Inventory;
import com.luyuan.crm.formula.service.InventoryService;
import com.ruijie.foundation.dao.extend.support.HibernateEntityExtendDao;
import com.ruijie.foundation.query.Page;
import com.ruijie.foundation.query.criteria.CriteriaQueryTemplate;
import com.ruijie.foundation.query.criteria.CriteriaTemplate;

@SuppressWarnings("unchecked")
public class InventoryServiceImpl  extends HibernateEntityExtendDao<Inventory> implements InventoryService{


	@Override
	public Page pagedQuery(CriteriaTemplate criteria, int pageNo, int pageSize,
			List<Order> orders) {
		CriteriaQueryTemplate qt = new CriteriaQueryTemplate(getSessionFactory());
        return qt.pagedQuery(criteria, pageNo, pageSize, orders);
	}


	@Override
	@Transactional(isolation = Isolation.READ_COMMITTED)
	public void deleteInventory(Inventory inventory) {
		this.remove(inventory);
	}
	
	
}	
